import request from '@/utils/request'

// 查询入库列表
export function listInout(query) {
  return request({
    url: '/stock/in/list',
    method: 'get',
    params: query
  })
}

// 查询入库详细
export function getInout(inoutId) {
  return request({
    url: '/stock/in/' + inoutId,
    method: 'get'
  })
}

// 新增入库
export function addInout(data) {
  return request({
    url: '/stock/in',
    method: 'post',
    data: data
  })
}

// 修改入库
export function updateInout(data) {
  return request({
    url: '/stock/in',
    method: 'put',
    data: data
  })
}

// 删除入库
export function delInout(inoutId) {
  return request({
    url: '/stock/in/' + inoutId,
    method: 'delete'
  })
}

/**
 * 采购订单选择
 */
export function getInoutByOrder(inoutId) {
  return request({
    url: '/stock/in/getInoutByOrder/' + inoutId,
    method: 'get'
  })
}

// 确认入库
export function inoutIn(data) {
  return request({
    url: '/stock/in/in',
    method: 'post',
    data: data
  })
}
